﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

/// <summary>
/// Summary description for AddminMethord
/// </summary>
public class AddminMethord
{
    SqlConnection sqlcon = Conection.getconnet();
	public AddminMethord()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public void ConnectOpen()
    {
        if (sqlcon.State == ConnectionState.Closed)
        {
            sqlcon.Open();
        }
    }
    public DataTable loginAdmin(string username, string pass) {
        DataTable dt = new DataTable();
        SqlCommand sqlcom = new SqlCommand("LoginManager",sqlcon);
        sqlcom.Parameters.Add("@UserName",username);
        sqlcom.Parameters.Add("@Password",pass);
        sqlcom.CommandType = CommandType.StoredProcedure;
        ConnectOpen();
        SqlDataAdapter sqlda = new SqlDataAdapter(sqlcom);
        DataSet ds = new DataSet();
        sqlda.Fill(ds);
        dt = ds.Tables[0];
        return dt;
    }
}